/*
 * Wire
 * Copyright (C) 2018 Wire Swiss GmbH
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see http://www.gnu.org/licenses/.
 *
 */

@accent_colors-0: transparent;
@accent_colors-1: @w-blue;
@accent_colors-2: @w-green;
@accent_colors-3: @w-yellow;
@accent_colors-4: @w-red;
@accent_colors-5: @w-orange;
@accent_colors-6: @w-pink;
@accent_colors-7: @w-purple;

.accent-color(@fade: 100%) {
  .main-accent-color-1 & {
    color: fade(@accent_colors-1, @fade);
  }
  .main-accent-color-2 & {
    color: fade(@accent_colors-2, @fade);
  }
  .main-accent-color-3 & {
    color: fade(@accent_colors-3, @fade);
  }
  .main-accent-color-4 & {
    color: fade(@accent_colors-4, @fade);
  }
  .main-accent-color-5 & {
    color: fade(@accent_colors-5, @fade);
  }
  .main-accent-color-6 & {
    color: fade(@accent_colors-6, @fade);
  }
  .main-accent-color-7 & {
    color: fade(@accent_colors-7, @fade);
  }
}

.accent-fill(@fade: 100%) {
  .main-accent-color-1 & {
    fill: fade(@accent_colors-1, @fade);
  }
  .main-accent-color-2 & {
    fill: fade(@accent_colors-2, @fade);
  }
  .main-accent-color-3 & {
    fill: fade(@accent_colors-3, @fade);
  }
  .main-accent-color-4 & {
    fill: fade(@accent_colors-4, @fade);
  }
  .main-accent-color-5 & {
    fill: fade(@accent_colors-5, @fade);
  }
  .main-accent-color-6 & {
    fill: fade(@accent_colors-6, @fade);
  }
  .main-accent-color-7 & {
    fill: fade(@accent_colors-7, @fade);
  }
}

.accent-background-color(@fade: 100%) {
  .main-accent-color-1 & {
    background-color: fade(@accent_colors-1, @fade);
  }
  .main-accent-color-2 & {
    background-color: fade(@accent_colors-2, @fade);
  }
  .main-accent-color-3 & {
    background-color: fade(@accent_colors-3, @fade);
  }
  .main-accent-color-4 & {
    background-color: fade(@accent_colors-4, @fade);
  }
  .main-accent-color-5 & {
    background-color: fade(@accent_colors-5, @fade);
  }
  .main-accent-color-6 & {
    background-color: fade(@accent_colors-6, @fade);
  }
  .main-accent-color-7 & {
    background-color: fade(@accent_colors-7, @fade);
  }
}

.accent-border-color(@fade: 100%) {
  .main-accent-color-1 & {
    border-color: fade(@accent_colors-1, @fade);
  }
  .main-accent-color-2 & {
    border-color: fade(@accent_colors-2, @fade);
  }
  .main-accent-color-3 & {
    border-color: fade(@accent_colors-3, @fade);
  }
  .main-accent-color-4 & {
    border-color: fade(@accent_colors-4, @fade);
  }
  .main-accent-color-5 & {
    border-color: fade(@accent_colors-5, @fade);
  }
  .main-accent-color-6 & {
    border-color: fade(@accent_colors-6, @fade);
  }
  .main-accent-color-7 & {
    border-color: fade(@accent_colors-7, @fade);
  }
}

.accent-color-selection-mixin(@accent_id) when (@accent_id > 0) {
  .accent-color-selection-mixin(@accent_id - 1);
  // output
  .main-accent-color-@{accent_id} & {
    @accent-color: 'accent_colors-@{accent_id}';
    &::-moz-selection {
      background-color: fade(@@accent-color, 24%);
    }
    &::selection {
      background-color: fade(@@accent-color, 24%);
    }
  }
}

.accent-selection-color() {
  .accent-color-selection-mixin(7);
}
